<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sistema de Administraci&oacute;n de Condominios - Mantenimiento de Viviendas</title>
<%@include file="include/header.jsp" %>
</head>
<body>
<%@include file="include/menu.jsp" %>
    <%		
		Persona vo = (Persona)session.getAttribute("user");
		
		if (vo== null){
			RequestDispatcher rd = request.getRequestDispatcher("error.jsp");
			rd.forward(request, response);
			return;
		}
	  %>
<div class="container">
	<div class="hero-unit" align="center">
	    	<h2><strong>Eliminar Registro de Viviendas</strong></h2><br>
	    </div>
	<%@page import="java.util.ArrayList,condominios.modelo.Vivienda"%>

	
  		<div class="row">		
  		<div class="col-md-5 col-md-offset-4">
  			<%
				Vivienda c2 = new Vivienda();
	  			c2 = (Vivienda) request.getAttribute("VIVIENDA_ELIMINAR");
				if (c2 != null) {%>
				
			<form method="post" action="ViviendaEliminarServlet">
			<div class="table-responsive">
			<table class="table table-striped table-bordered table-condensed">
			

  				<tr class="success" ><th colspan="2">Por favor, estos son los datos del registro a eliminar</th>
				</tr>
  				<tr>
  					<td>Id Vivienda</td><td><input type="text" name="txtIdViviendaC" value="<%=c2.getCodigo()%>"/></td>
  				</tr>
  				<tr>
  					<td>Tipo de Vivienda:</td><td><select name="slTipoViviendaC"><%if (c2.getCodTipo()==1) { %>
					<option value="1">Casa</option>
					<option value="2">Departamento</option>
				</select>
					<%	
	  					}
	  					else {
	  						%><option value="2">Departamento</option>
	  						<option value="1">Casa</option>
	  						<%
	  					}
	  					%>
				</td>
  				</tr>	
  				<tr>
  					<td>Estado:</td><td><select name="slEstadoC"><%if (c2.getEstado()==1) { %>
					<option value="1">Propio</option>
					<option value="0">Alquilado</option>
				</select>
					<%	
	  					}
	  					else {
	  						%><option value="0">Alquilado</option>
	  						<option value="1">Propio</option>
	  						<%
	  					}
	  					%>
				</td>
  				</tr>
  				<tr>
  					<td>Persona:</td><td><input type="text" name="txtPersonaC" value="<%=c2.getIdPersona()%>"/></td>
  				</tr>
  				
			</table>
		</div>			
			<%
  				}			
  				%>	
  			</div>
  		</div> 			
  			<div class="row">		
  		<div class="col-md-12" align="center">
  		
		  	<button type="submit" class="btn btn-primary" name="eliminarViviendaE"/>Eliminar</button>
			<button type="submit" class="btn btn-primary" name="cancelar1ViviendaE"/>Cancelar</button>
			
			</div>
			
			</div>	
  		</form>			
			
			<div class="row">		
  		<div class="col-md-12" align="center">
  		
		    <footer>
        	<p>&copy; Java Tigers 2015</p>
        	</footer>
			
			</div>
			
			</div>
		</div>
		
	
</body>
</html>